import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '../views/Home/Home.vue';
import Company from '../views/Company/Company.vue';
import Discounts from '../views/Discounts/Discounts.vue';
import Pedia from '../views/Pedia.vue';
import QA from '../views/Q&A/Q&A.vue';
import Guarantee from '../views/Guarantee/Guarantee.vue';
import Crown from '../views/Crown.vue';
import BBS from '../views/BBS.vue';
import Report from '../views/Report/Report.vue';

Vue.use(VueRouter);

const routes = [{
  path: '/',
  redirect: '/home'
}, {
  path: '/home',
  name: 'Home',
  component: Home,
}, {
  path: '/company',
  name: 'Company',
  component: Company,
  children: [{
    path: '/company',
    name: 'companyList',
    component: () => import('../views/Company/CompanyList.vue'),
  }, {
    path: '/company/:id',
    name: 'companyDetail',
    component: () => import('../views/Company/CompanyDetail.vue'),
  }]
}, {
  path: '/discounts',
  name: 'Discounts',
  component: Discounts
}, {
  path: '/pedia',
  name: 'Pedia',
  component: Pedia,
}, {
  path: '/qa',
  name: 'QA',
  component: QA,
}, {
  path: '/guarantee',
  name: 'Guarantee',
  component: Guarantee,
}, {
  path: '/crown',
  name: 'Crown',
  component: Crown,
}, {
  path: '/bbs',
  name: 'BBS',
  component: BBS,
}, {
  path: '/report',
  name: 'Report',
  component: Report,
}];

const router = new VueRouter({
  routes,
});

export default router;
